//**********定时任务***********/;
import request from '@/utils/request.js';

/**
 * 保存
 * @doc http://hanma-lesscode.hc-iiot.com/swagger-ui.html#!/
 * data 参数 
 *  concurrent:'', //是否并发执行 	类型:string 非必填
 *  cronExpression:'', //cron执行表达式 	类型:string 非必填
 *  invokeTarget:'', //调用目标字符串 	类型:string 非必填
 *  jobGroup:'', //任务组名 	类型:string 非必填
 *  jobName:'', //任务名称 	类型:string 非必填
 *  misfirePolicy:'', //计划执行错误策略 	类型:string 非必填
 *  remark:'', //备注 	类型:string 非必填
 *  scriptId:'', // 	类型:integer 非必填
 *  status:'', //是否正常状态 	类型:string 非必填
 * @returns
 * ********
 */
export function postHmjob(data={}, config={}){
  return request({
    method: 'post',
    data,
    url: `/api/hmjob`,
    ...config,
  }) 
}

/**
 * 修改
 * @doc http://hanma-lesscode.hc-iiot.com/swagger-ui.html#!/
 * data 参数 
 *  concurrent:'', //是否并发执行 	类型:string 非必填
 *  cronExpression:'', //cron执行表达式 	类型:string 非必填
 *  invokeTarget:'', //调用目标字符串 	类型:string 非必填
 *  jobGroup:'', //任务组名 	类型:string 非必填
 *  jobId:'', //$column.comments 	类型:string 非必填
 *  jobName:'', //任务名称 	类型:string 非必填
 *  misfirePolicy:'', //计划执行错误策略 	类型:string 非必填
 *  remark:'', //备注 	类型:string 非必填
 *  scriptId:'', // 	类型:integer 非必填
 *  status:'', //是否正常状态 	类型:string 非必填
 * @returns
 * ********
 */
export function putHmjob(data={}, config={}){
  return request({
    method: 'put',
    data,
    url: `/api/hmjob`,
    ...config,
  }) 
}

/**
 * 删除
 * @doc http://hanma-lesscode.hc-iiot.com/swagger-ui.html#!/
 * data 参数 // 类型 array
 * []string
 * @returns
 * ********
 */
export function deleteHmjob(data=[], config={}){
  return request({
    method: 'delete',
    data,
    url: `/api/hmjob`,
    ...config,
  }) 
}

/**
 * 更新状态
 * @doc http://hanma-lesscode.hc-iiot.com/swagger-ui.html#!/
 * params 参数 
 * jobId:'', //jobId 必填
 * @returns
 * ********
 */
export function putHmjobChangeStatus(params={}, config={}){
  return request({
    method: 'put',
    params,
    url: `/api/hmjob/changeStatus`,
    ...config,
  }) 
}

/**
 * 任务信息
 * @doc http://hanma-lesscode.hc-iiot.com/swagger-ui.html#!/
 * params 参数 
 * id:'', //id 必填
 * @returns
 * ********
 */
export function getHmjobInfo(params={}, config={}){
  return request({
    method: 'get',
    params,
    url: `/api/hmjob/info`,
    ...config,
  }) 
}

/**
 * 分页列表
 * @doc http://hanma-lesscode.hc-iiot.com/swagger-ui.html#!/
 * params 参数 
 * pageNo:'', //页码 非必填
 * pageSize:'', //每页数据条数 非必填
 * jobName:'', //jobName 非必填
 * jogGroup:'', //jogGroup 非必填
 * misfirePolicy:'', //misfirePolicy 非必填
 * concurrent:'', //concurrent 非必填
 * status:'', //status 非必填
 * @returns
 * ********
 */
export function getHmjobPageList(params={}, config={}){
  return request({
    method: 'get',
    params,
    url: `/api/hmjob/page/list`,
    ...config,
  }) 
}

/**
 * 运行任务
 * @doc http://hanma-lesscode.hc-iiot.com/swagger-ui.html#!/
 * params 参数 
 * jobId:'', //jobId 必填
 * @returns
 * ********
 */
export function putHmjobRun(params={}, config={}){
  return request({
    method: 'put',
    params,
    url: `/api/hmjob/run`,
    ...config,
  }) 
}

/**
 * 验证cron表达式
 * @doc http://hanma-lesscode.hc-iiot.com/swagger-ui.html#!/
 * params 参数 
 * cron:'', //cron 必填
 * @returns
 * ********
 */
export function getHmjobValidatecron(params={}, config={}){
  return request({
    method: 'get',
    params,
    url: `/api/hmjob/validate-cron`,
    ...config,
  }) 
}